
# 13. 求s=a+aa+aaa+aaaa+aa...a的值，其中a是一个数字。例如2+22+222+2222+22222(此时共有5个数相加)，几个数相加由键盘控制。
"""
分析 ：
a = 2
循环的次数 ：i
temp = 0

2   = 2 + 0
22  = 20 + 2
222 = 200 + 22
2222= 2000 + 222

# 规律
temp = a * 10 ** i +  temp
temp += a * 10 ** i
"""

# a = 2
# i = input("请输入一个数字:")
# i = int(i)
# sum,temp = 0,0
# for x in range(i):
#     temp += a * 10 ** x
#     sum += temp
# print(sum)


# 14. 题目：打印出如下图案（菱形）:
# for x in range(1,5):
#     space = " " * (4 - x)
#     star = "*" * (2*x -1)
#     print(space + star)
# for y in range(1,4):
#     space = y * " "
#     star = (7 - 2*y) * "*"
#     print(space + star)

num = 7
for x in range(1,5):
    star = (2*x-1) * "*"
    print(star.center(num))
for y in range(1,4):
    star = (7 - 2*y) * "*"
    print(star.center(num))

print("="*30)

for x in range(1,num+1):
    if x <= 4:
        star = (2 * x - 1) * "*"
        print(star.center(num))
    else:
        star = (7 - 2 * (x-4)) * "*"
        print(star.center(num))


# import project01.iter01
from project01.iter01 import login

# print(project01.iter01.login('admin','123456'))

login('admin','123456')
